//
//  T3FPolylineColors.swift
//  t3_map
//
//  Created by 梅秋实 on 2024/12/31.
//

import Foundation
import t3_assets

public enum T3FPolylineColorMold: Int, CaseIterable {
    case unknow = 0
    case clear = 1
    case slow = 2
    case bad = 3
    case serious = 4
    
    public var selectImage: UIImage? {
        switch self {
        case .serious:
            
            if let image = UIImage.t3_assetsWith(T3AssetsName.map_bg_traffic_serious) {
                return image
            }
        case .bad:
            if let image = UIImage.t3_assetsWith(T3AssetsName.map_bg_traffic_bad) {
                return image
            }
        case .slow:
            if let image = UIImage.t3_assetsWith(T3AssetsName.map_bg_traffic_slow) {
                return image
            }
        case .unknow:
            if let image = UIImage.t3_assetsWith(T3AssetsName.map_bg_traffic_unknown) {
                return image
            }
        default:
            break
        }
        return UIImage.t3_assetsWith(T3AssetsName.map_bg_traffic_normal)
    }
    
    var unSelectImage: UIImage? {
        switch self {
        case .serious:
            if let image = UIImage.t3_assetsWith(T3AssetsName.map_bg_traffic_serious_unselect) {
                return image
            }
        case .bad:
            if let image = UIImage.t3_assetsWith(T3AssetsName.map_bg_traffic_bad_unselect) {
                return image
            }
        case .slow:
            if let image = UIImage.t3_assetsWith(T3AssetsName.map_bg_traffic_slow_unselect) {
                return image
            }
        case .unknow:
            if let image = UIImage.t3_assetsWith(T3AssetsName.map_bg_traffic_unknown_unselect) {
                return image
            }
        default:
            break
        }
        return UIImage.t3_assetsWith(T3AssetsName.map_bg_traffic_normal_unselect)
    }
    
    //    0:通畅 1:缓行 2:堵塞 3:未知路况 4:严重堵塞.
    // 获取导航SDK默认路况颜色
    var selectColor: UIColor {
        switch (self) {
            
        case .slow:
            return T3FColorUtil.hex("FABB11")
        case .bad:
            return T3FColorUtil.hex("E61C3F")
        case .unknow:
            return T3FColorUtil.hex("6ca4f2")
        case .serious:
            return T3FColorUtil.hex("932632")
        default:
            return T3FColorUtil.hex("05B473")
            //                return UIColor.hex("c2c2c2")
        }
    }
    
    // 获取导航SDK备选路况颜色
    var unSelectColor: UIColor {
        switch (self) {
        case .slow:
            return T3FColorUtil.hex("F6D28B")
        case .bad:
            return T3FColorUtil.hex("DEADA6")
        case .unknow:
            return T3FColorUtil.hex("A8C5FB")
        case .serious:
            return T3FColorUtil.hex("CA99A2")
        default:
            return T3FColorUtil.hex("a5dab6")
            //                return UIColor.hex("c2c2c2")
        }
    }
}
